home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ADA Programming Guide
/
ADA Programming Guide.iso
/
ada_a9x
/
ex1.ada
< prev
next >
Wrap
Text File
|
1996-01-30
|
1KB
|
43 lines
--PRAGMA LIST(On);
-- Source Ex1.Ada
-- By Arthur V. Lopes, 7/12/94
-- This Program places ten times the letter A in the first Screen line
-- and ten times the letter B in the second Screen line.
-- The main program calls two procedures, Display_A and Display_B.
-- Each procedure display 10 times a letter designator.
-- The next program, Concurrent_Programming_1, will attempt to do the same
-- by using two tasks. Each task will replace the procedure call and the
-- procedure bodies.
-- Study carfully the differences among the two approaches.
WITH Ada.Text_IO, VT100; USE Ada.Text_IO, VT100;
PROCEDURE Sequential_Programming IS
SUBTYPE Interval IS INTEGER RANGE 1 .. 10;
PROCEDURE Display_A IS
BEGIN
FOR I IN Interval LOOP
MoveCursor(I,1);
DELAY 0.01;
Put('A');
END LOOP;
END Display_A;
PROCEDURE Display_B IS
BEGIN
FOR I IN Interval LOOP
MoveCursor(I,2);
DELAY 0.01;
Put('B');
END LOOP;
END Display_B;
BEGIN
ClearScreen;
Display_A;
Display_B;
MoveCursor(1,3);
END Sequential_Programming;